package com.fenghongzhang.kotlin1903.room

import androidx.room.*

@Dao
interface StudentDao {

    //返回的id
    @Insert
    fun insertStudent(student: Student) : Long

    //返回的是影响的行数
    @Update
    fun updateStudent(student: Student) : Int

    @Delete
    fun deleteUser(student: Student) :Int

    @Query("select * from Student")
    fun selectAll():List<Student>

    @Query("select * from Student where id = :aid")
    fun selectStudentById(aid:Long):List<Student>

    @Query("select * from Student where name = :name ")
    fun selectStudentByName(name:String):List<Student>

}